package com.flying.cattle.redismq;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.ReactiveRedisTemplate;
import org.springframework.stereotype.Service;

@Service
public class PublishService {
	@Qualifier("reactiveJsonPostRedisTemplate")
	@Autowired
    ReactiveRedisTemplate redisTemplate;

	public void publish(String channel,Object message) {
		redisTemplate.convertAndSend(channel, message).subscribe();
	}
}
